package com.example.client.rpc;

import java.lang.reflect.Proxy;

/**
 * @author heyuduo
 * @date 2022/6/18 16:33
 */
public class RpcClientProxy {

    public <T> T clientProxy(final Class<T> interfaces, final String host, final int port) {

        return (T) Proxy.newProxyInstance(interfaces.getClassLoader(), new Class[]{interfaces}, new RpcInvocationHandler(host, port));
    }
}
